<?php
	
class C extends MY_Controller
{	
	function __construct()
	{
		parent::__construct();
		
		$this->contenttype = 'news';
		// defined categories (all news, hot news, news based on cat)
		$this->cat = array('hotnews');
		// defined environment (development,test,production)
		$this->environment = 'production';
		// template path
		$this->template_path = 'newtest';
		// action page
		$this->action_pages = array(
				'index'	=>	array (
					'title'=>'Trang chủ',
					'data'=> array (
							'home_hotnews','home_ad','home_cat_news'
						),
					),
				'newest'	=>	array('title'=>'Tin mới'),
				'entertain'	=>	array('title'=>'Giải trí'),
				'biz'	=>	array('title'=>'Kinh doanh'),
				'tech'	=>	array('title'=>'Công nghệ'),
			);
	}
		
	// example: get all news, get hot news, news based on cat
	// change index to other name (vietnamese title)
	/*
	 * Page action following format
	 * 
	 * 
	*/
	function index($page_action = '')
	{		
		// if empty page's action, assign it to index as default
		if( empty($page_action) || $page_action == '' )
		{
			$page_action = 'index';
		}

		// Show content only when page is defined
		if( array_key_exists($page_action, $this->action_pages) )
		{
			$this->getContent($page_action);
		}
		else
		{
			echo 'Page not defined !';
		}		
	}
	 	
}